class People(object):

    # 私有属性
    __avtar = "default.png"

    # 公有属性
    head = "head.png"

    def __init__(self, name, code):
        self.name = name
        self.code = code

    # 公有方法
    def eat(self):
        print(self.name,"【", self.code, "】", ":", "吃饭")
        self.__digest()
    # 私有方法
    def __digest(self):
        print(self.name,"【", self.code, "】", ":", "消化完食物")

if __name__ == '__main__':
    people = People('hwj', '666')
    print(people.name, people.code)
    people.eat()

    # 公有属性可以调用
    print(people.head)
